package com.dragon.loan.service;

import java.util.HashSet;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dragon.loan.entity.BlackInfoEntity;
import com.dragon.loan.repository.BlackInfoMapper;

@Service
public class BlackInfoServiceImpl implements BlackInfoIDragonService{
	@Autowired
	private BlackInfoMapper blackInfoMapper;

	@Override
	public HashSet<String> getAllMobile() {
		List<String> mobileList = blackInfoMapper.findAll();
		if(mobileList==null||mobileList.size()==0){
			return null;
		}
		HashSet<String> mobileSet = new HashSet<String>();
		for (String mobile : mobileList) {
			mobileSet.add(mobile);
		}
		return mobileSet;
	}

	@Override
	public BlackInfoEntity findByMobile(String mobileNo) {
		return blackInfoMapper.findByMobile(mobileNo);
	}

}
